import logging


def logger():
    logging.basicConfig(level=logging.DEBUG,
                        format='%(asctime)s %(filename)s[line:%(lineno)d] [%(levelname)s] %(message)s',
                        datefmt='%a, %d %b %Y %H:%M:%S',
                        filename='/home/yangming/log/log.log',
                        )

    logger = logging.getLogger('log')
    console = logging.StreamHandler()
    console.setLevel(logging.DEBUG)
    formate = logging.Formatter('%(asctime)s %(filename)s[line:%(lineno)d] [%(levelname)s] %(message)s')
    console.setFormatter(formate)
    logger.addHandler(console)
    return logger
